import React from 'react';
import {useRecoilValue} from "recoil";
import {getTextLengthAndToUpper} from "../../recoils/selectors";

function SelectorDemo() {

    const obj = useRecoilValue(getTextLengthAndToUpper);
    console.log('--useRecoilValue in recoil--')


    return (<div className="form-group border">
        <h3>selector in recoil</h3>
        <div className="form-group">
            <span className="text-primary">selector: </span>
            <p>长度：{obj.length}</p>
            <p>大写：{obj.upper}</p>

        </div>
    </div>)
}

export default React.memo(SelectorDemo);